$(function () {
	scrollLoad(); //响应滚动加载课程图片
	showPages({currentPage: currentPage, totalPage: totalPage});
});

function setCategoryId(value) {
	categoryId = value;
	jumpList();
}
function setOrderBy(value) {
	orderBy = value;
	jumpList();
}
function setIsLiving(value) {
	isLiving = value;
	jumpList();
}
function setMemberType(value) {
	memberTypeId = value;
	jumpList();
}
/*查询套餐课程*/
function setPackage(obj) {
	/*如果按钮被选中了*/
	if ($(obj).hasClass("check")) {
		sellType = "";
		$(obj).removeClass("check")
	} else {
		sellType = "PACKAGE";
		$(obj).addClass("check")
	}
	jumpList();
}
/*查询免费课程*/
function setIsFree() {
	if (isFree === 0) {
		isFree = 1;
	} else {
		isFree = 0;
	}
	jumpList();
}
function jumpList() {
	var url = "list.html?categoryId=" + categoryId;
	if (teacherId > 0) {
		url += "&teacherId=" + teacherId;
	}
	if (orderBy > 0) {
		url += "&orderBy=" + orderBy;
	}
	if (isFree > 0) {
		url += "&isFree=" + isFree;
	}
	if (isLiving > 0) {
		url += "&isLiving=" + isLiving;
	}
	if (sellType !== '') {
		url += "&sellType=" + sellType;
	}
	location.href = url;
}